<html>
<head>
	<title>芭蕉花管理平台-用户信息详情</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<link rel="SHORTCUT ICON" href="/img/favicon.ico">
	<script type="text/javascript">
		var pathname = window.location.pathname;
		if (pathname != "/mobile/home.html") {
			location.href = '/';
		}
	</script>
	<style type="text/css">
		.tab-content {margin-top: 10px; margin-bottom: 10px;}
		.info-item .title {display: inline-block; font-size: .8rem; color: #999; width: 8rem;}
		.info-item .content {display: inline-block; font-size: .8rem; word-break: break-all;}
		.info-item .content .img {width: 4rem; height: 4rem; padding: 2px;}
		.info-item .content .status {padding: .5em;}
		.search-box.condition-hidden .search-condition {display: none;}
		.btn {appearance: none; -moz-appearance: none; -webkit-appearance: none;}
		.card {border-radius: 0; border-left: 0; border-right: 0; overflow: visible;}
		.card-header {padding: 0;border-radius: 0; background-color: #fff;}
		.card-header .btn {border-radius: 0; background-color: rgba(0,0,0,.03);}
		.card-header .btn.collapsed {background-color: #fff;}
		.card-body {padding: 0.5rem;}
		.card-img-box {text-align: center; padding-bottom: 0.25rem;}
		.card-img {width: 4rem; height: 4rem; padding : 2px; box-shadow: 1px 2px 10px #bbb;}
		.card-title {font-size: 1rem; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem;}
		.card-item {font-size: .875em; color: #777;}
		.card-item .left {display: inline-block; width: 50%; text-align: left;}
		.card-item .right {display: inline-block; width: 50%; text-align: right;}
		.card-status .status {display: inline-block; width: 50%; text-align: left; padding: .25rem;}
		.card-status .pay-status {display: inline-block; width: 50%; text-align: right;}
		.card-time {font-size: .6rem; color: #aaa; text-align: right;}
		.list-item {padding-top: .5rem; border-bottom: 1px solid rgba(0,0,0,.125);}
		.list-item {color: #666; font-size: .875rem;}
		.list-item .left {display: inline-block; width: 50%; text-align: left;}
		.list-item .right {display: inline-block; width: 50%; text-align: right;}
		.list-item .time {font-size: .6rem; color: #aaa; text-align: right;}
		ul.card-opt {display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; padding: 0; margin: 0;}
		ul.card-opt.divider {border-top: 1px solid #ccc;}
		ul.card-opt>li {position: relative; display: block; padding-top: 3em; -webkit-box-flex: 1; -webkit-flex: 1 0 auto; -ms-flex: 1 0 auto; flex: 1 0 auto;}
		ul.card-opt>li:active {background: rgba(0,123,255,.15);}
		ul.card-opt>li>i {position: absolute; top: .25em; left: 0; right: 0; display: block; text-align: center; line-height: 1em; font-size: 2em;}
		ul.card-opt>li>span {display: block; text-align: center;}
		.data-info {margin-top: .5rem; font-size: .6rem; color: #777; text-align: right;}
		.page-list {margin-top: 1.25rem;}
		.page-list nav {display: inline-block;}
		.page-list .page-link:hover {z-index: 2; color: #007bff; text-decoration: none; background-color: #fff; border-color: #dee2e6;}
		.page-list .page-link:active {z-index: 2; color: #0056b3; text-decoration: none; background-color: #e9ecef; border-color: #dee2e6;}
		.page-list .page-link:focus {box-shadow: none;}
	</style>
</head>
<body>
	<div class="container">
		<nav aria-label="breadcrumb">
			<ol class="breadcrumb">
				<li class="breadcrumb-item"><a href="#" onclick="goUserList();return false;"><i class="fa fa-chevron-left"></i><span style="padding-left: 10px;">用户管理</span></a></li>
				<li class="breadcrumb-item active" aria-current="page">用户信息详情</li>
			</ol>
		</nav>
		<nav>
			<div class="nav nav-tabs" id="nav-tab" role="tablist">
				<a class="nav-item nav-link active" id="nav-tab-detail" data-toggle="tab" href="#nav-detail" role="tab" aria-controls="nav-detail" aria-selected="true">基本信息</a>
				<a class="nav-item nav-link" id="nav-tab-card-list" data-toggle="tab" href="#nav-card-list" role="tab" aria-controls="nav-card-list" aria-selected="false">银行卡</a>
				<a class="nav-item nav-link" id="nav-tab-crowdfund-list" data-toggle="tab" href="#nav-crowdfund-list" role="tab" aria-controls="nav-crowdfund-list" aria-selected="false">众筹记录</a>
				<a class="nav-item nav-link" id="nav-tab-point-list" data-toggle="tab" href="#nav-point-list" role="tab" aria-controls="nav-point-list" aria-selected="false">积分</a>
				<a class="nav-item nav-link" id="nav-tab-credit-list" data-toggle="tab" href="#nav-credit-list" role="tab" aria-controls="nav-credit-list" aria-selected="false">信用分</a>
				<a class="nav-item nav-link" id="nav-tab-amt-list" data-toggle="tab" href="#nav-amt-list" role="tab" aria-controls="nav-amt-list" aria-selected="false">可用额度</a>
			</div>
		</nav>
		<div class="tab-content" id="nav-tabContent">
			<div class="tab-pane fade show active" id="nav-detail" role="tabpanel" aria-labelledby="nav-tab-detail">
				<div class="row">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="showEditDialog()"  class="btn btn-block btn-info">编辑用户资料</button>
						</div>
					</div>
				</div>

				<div class="card">
					<div class="card-body">
						<div class="info-item">
							<div class="title">用户ID</div>
							<div class="content" id="infoUserId"></div>
						</div>
						<div class="info-item">
							<div class="title">账号</div>
							<div class="content" id="infoAccount"></div>
						</div>
						<div class="info-item">
							<div class="title">钱包总金额</div>
							<div class="content" id="infoWalletTotal"></div>
						</div>
						<div class="info-item">
							<div class="title">红包总金额</div>
							<div class="content" id="infoRedbagTotal"></div>
						</div>
						<div class="info-item">
							<div class="title">总积分</div>
							<div class="content" id="infoUserPoint"></div>
						</div>
						<div class="info-item">
							<div class="title">总信用分</div>
							<div class="content" id="infoCreditPoint"></div>
						</div>
						<div class="info-item">
							<div class="title">Plus会员</div>
							<div class="content" id="infoIsPlus"></div>
						</div>
						<div class="info-item">
							<div class="title">会员到期时间</div>
							<div class="content" id="infoPlusExpireTime"></div>
						</div>
						<div class="info-item">
							<div class="title">头像</div>
							<div class="content" id="infoAvatar"></div>
						</div>
						<div class="info-item">
							<div class="title">昵称</div>
							<div class="content" id="infoUserName"></div>
						</div>
						<div class="info-item">
							<div class="title">性别</div>
							<div class="content" id="infoGender"></div>
						</div>
						<div class="info-item">
							<div class="title">年龄</div>
							<div class="content" id="infoAge"></div>
						</div>
						<div class="info-item">
							<div class="title">手机号</div>
							<div class="content" id="infoMobile"></div>
						</div>
						<div class="info-item">
							<div class="title">身份证号</div>
							<div class="content" id="infoIdCard"></div>
						</div>
						<div class="info-item">
							<div class="title">人脸校验分数</div>
							<div class="content" id="infoValue"></div>
						</div>
						<div class="info-item">
							<div class="title">真实姓名</div>
							<div class="content" id="infoPartyName"></div>
						</div>
						<div class="info-item">
							<div class="title">抢红包次数</div>
							<div class="content" id="infoSysRedbagCount"></div>
						</div>
						<div class="info-item">
							<div class="title">大转盘次数</div>
							<div class="content" id="infoSysWheelCount"></div>
						</div>
						<div class="info-item">
							<div class="title">兑换大转盘剩余次数</div>
							<div class="content" id="infoConvertWheelCount"></div>
						</div>
						<div class="info-item">
							<div class="title">本月剩余众筹次数</div>
							<div class="content" id="infoCrowdfundCount"></div>
						</div>
						<div class="info-item">
							<div class="title">贡献值</div>
							<div class="content" id="infoContribution"></div>
						</div>
						<div class="info-item">
							<div class="title">用户状态</div>
							<div class="content" id="infoStatus"></div>
						</div>
						<div class="info-item">
							<div class="title">注册时间</div>
							<div class="content" id="infoCreateTime"></div>
						</div>
						<div class="info-item">
							<div class="title">注册时间</div>
							<div class="content" id="infoUsableAmt"></div>
						</div>
					</div>
				</div>
			</div>

			<div class="tab-pane fade" id="nav-crowdfund-list" role="tabpanel" aria-labelledby="nav-tab-crowdfund-list">

				<div class="row collapse" id="searchBox_crowdfund">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchSort_crowdfund">
								<option value="1">升序</option>
								<option value="2">降序</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchStatus_crowdfund">
								<option value="">选择状态</option>
								<option value="0">待审核</option>
								<option value="1">进行中</option>
								<option value="2">付款中</option>
								<option value="3">已结束</option>
								<option value="4">进行中(已扣分) </option>
								<option value="5">已驳回</option>
								<option value="6">已失效</option>
		<!-- 						<option value="21">付款中(暂停付款)</option> -->
								<option value="22">进行中(已证明)</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchCardType_crowdfund">
								<option value="">选择收款银行卡类别</option>
								<option value="1">储蓄卡</option>
								<option value="2">支付宝</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchType_crowdfund">
								<option value="">选择类型</option>
								<option value="1">江湖救急</option>
								<!--<option value="2">还房贷</option>-->
								<!--<option value="3">还车贷</option>-->
								<!--<option value="4">还信用卡</option>-->
								<option value="5">求助</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<input type="text" id="searchKey_crowdfund" class="form-control" placeholder="输入标题/发单人/用户账号/筹集金额搜索"/>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="search_crowdfund();"  class="btn btn-block btn-primary">搜索</button>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<a type="button" id="searchBoxCollapse_crowdfund" class="btn btn-block btn-light" data-toggle="collapse" data-target="#searchBox_crowdfund" aria-expanded="false" aria-controls="searchBox_crowdfund"><span style="padding-right: 1rem; font-size: 0.875rem; color: #999;">搜索条件</span><i class="fa fa-angle-double-down text-primary" aria-hidden="true"></i> <i class="fa fa-angle-double-up text-primary" aria-hidden="true"></i></a>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xl-12">
						<div class="accordion" id="listBox_crowdfund">
						</div>
					</div>
				</div>
				<div id="dataInfo_crowdfund" class="data-info">
				</div>

				<div class="row page-list" id="pageList_crowdfund">
					<div class="col-xl-12 text-center">
						<nav aria-label="...">
							<ul class="pagination">
								<li class="page-item previous disabled">
									<a class="page-link" href="#" onclick="goPrevious_crowdfund();return false;">上一页</a>
								</li>
								<li class="page-item next disabled">
									<a class="page-link" href="#" onclick="goNext_crowdfund();return false;">下一页</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>
			</div>

			<div class="tab-pane fade" id="nav-card-list" role="tabpanel" aria-labelledby="nav-tab-card-list">

				<div class="row collapse" id="searchBox_card">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchStatus_card">
								<option value="">选择状态</option>
								<option value="0">已绑定</option>
								<option value="1">已解绑</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<input type="text" id="searchKey_card" class="form-control" placeholder="输入名称搜索"/>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="search_card();"  class="btn btn-block btn-primary">搜索</button>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<a type="button" id="searchBoxCollapse_card" class="btn btn-block btn-light" data-toggle="collapse" data-target="#searchBox_card" aria-expanded="false" aria-controls="searchBox_card"><span style="padding-right: 1rem; font-size: 0.875rem; color: #999;">搜索条件</span><i class="fa fa-angle-double-down text-primary" aria-hidden="true"></i> <i class="fa fa-angle-double-up text-primary" aria-hidden="true"></i></a>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xl-12">
						<div class="accordion" id="listBox_card">
						</div>
					</div>
				</div>
				<div id="dataInfo_card" class="data-info">
				</div>

				<div class="row page-list" id="pageList_card">
					<div class="col-xl-12 text-center">
						<nav aria-label="...">
							<ul class="pagination">
								<li class="page-item previous disabled">
									<a class="page-link" href="#" onclick="goPrevious_card();return false;">上一页</a>
								</li>
								<li class="page-item next disabled">
									<a class="page-link" href="#" onclick="goNext_card();return false;">下一页</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>
			</div>

			<div class="tab-pane fade" id="nav-point-list" role="tabpanel" aria-labelledby="nav-tab-point-list">

				<div class="row collapse" id="searchBox_point">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<label for="startDate_point">开始日期</label>
							<input type="date" id="searchStartDate_point" class="form-control" placeholder="开始日期"/>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<label for="startDate_point">结束日期</label>
							<input type="date" id="searchEndDate_point" class="form-control" placeholder="结束日期"/>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="search_point();"  class="btn btn-block btn-primary">搜索</button>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<a type="button" id="searchBoxCollapse_point" class="btn btn-block btn-light" data-toggle="collapse" data-target="#searchBox_point" aria-expanded="false" aria-controls="searchBox_credit"><span style="padding-right: 1rem; font-size: 0.875rem; color: #999;">搜索条件</span><i class="fa fa-angle-double-down text-primary" aria-hidden="true"></i> <i class="fa fa-angle-double-up text-primary" aria-hidden="true"></i></a>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<span>总积分：</span><span id="totalPoint" class="text-danger"></span>
						</div>
					</div>
				</div>
		
				<div id="listBox_point">
				</div>
				<div id="dataInfo_point" class="data-info">
				</div>

				<div class="row page-list" id="pageList_point">
					<div class="col-xl-12 text-center">
						<nav aria-label="...">
							<ul class="pagination">
								<li class="page-item previous disabled">
									<a class="page-link" href="#" onclick="goPrevious_point();return false;">上一页</a>
								</li>
								<li class="page-item next disabled">
									<a class="page-link" href="#" onclick="goNext_point();return false;">下一页</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>

			</div>

			<div class="tab-pane fade" id="nav-credit-list" role="tabpanel" aria-labelledby="nav-tab-credit-list">

				<div class="row collapse" id="searchBox_credit">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchType_credit">
								<option value="">选择类型</option>
								<option value="1">发红包</option>
								<option value="2">互助</option>
								<option value="3">登录</option>
								<option value="4">其它</option>
								<option value="5">违规</option>
								<option value="6">申诉</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="search_credit();"  class="btn btn-block btn-primary">搜索</button>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<a type="button" id="searchBoxCollapse_credit" class="btn btn-block btn-light" data-toggle="collapse" data-target="#searchBox_credit" aria-expanded="false" aria-controls="searchBox_credit"><span style="padding-right: 1rem; font-size: 0.875rem; color: #999;">搜索条件</span><i class="fa fa-angle-double-down text-primary" aria-hidden="true"></i> <i class="fa fa-angle-double-up text-primary" aria-hidden="true"></i></a>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<span>总信用分：</span><span id="totalCreditPoint" class="text-danger"></span>
						</div>
					</div>
				</div>
		
				<div id="listBox_credit">
				</div>
				<div id="dataInfo_credit" class="data-info">
				</div>

				<div class="row page-list" id="pageList_credit">
					<div class="col-xl-12 text-center">
						<nav aria-label="...">
							<ul class="pagination">
								<li class="page-item previous disabled">
									<a class="page-link" href="#" onclick="goPrevious_credit();return false;">上一页</a>
								</li>
								<li class="page-item next disabled">
									<a class="page-link" href="#" onclick="goNext_credit();return false;">下一页</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>

			</div>

			<div class="tab-pane fade" id="nav-amt-list" role="tabpanel" aria-labelledby="nav-tab-amt-list">

				<div class="row collapse" id="searchBox_amt">
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<select class="form-control" id="searchType_amt">
								<option value="">选择类型</option>
								<option value="0">永久额度</option>
								<option value="1">临时额度</option>
							</select>
						</div>
					</div>
					<div class="col-sm-6 col-md-4 col-lg-3 col-xl-2">
						<div class="form-group">
							<button type="button" onclick="search_amt();"  class="btn btn-block btn-primary">搜索</button>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<a type="button" id="searchBoxCollapse_amt" class="btn btn-block btn-light" data-toggle="collapse" data-target="#searchBox_amt" aria-expanded="false" aria-controls="searchBox_amt"><span style="padding-right: 1rem; font-size: 0.875rem; color: #999;">搜索条件</span><i class="fa fa-angle-double-down text-primary" aria-hidden="true"></i> <i class="fa fa-angle-double-up text-primary" aria-hidden="true"></i></a>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xl-12">
						<div class="form-group">
							<span>可用额度：</span><span id="usableAmt" class="text-danger"></span>
							<span>永久额度：</span><span id="permanentAmt" class="text-danger"></span>
							<span>临时额度：</span><span id="fixedAmt" class="text-danger"></span>
						</div>
					</div>
				</div>
		
				<div id="listBox_amt">
				</div>
				<div id="dataInfo_amt" class="data-info">
				</div>

				<div class="row page-list" id="pageList_amt">
					<div class="col-xl-12 text-center">
						<nav aria-label="...">
							<ul class="pagination">
								<li class="page-item previous disabled">
									<a class="page-link" href="#" onclick="goPrevious_amt();return false;">上一页</a>
								</li>
								<li class="page-item next disabled">
									<a class="page-link" href="#" onclick="goNext_amt();return false;">下一页</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>

			</div>
		</div>
	</div>

<!-- 【编辑】弹出窗内容 -->
<div class="modal fade" id="editPanel" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title" id="editTitle"></h4>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<form id="editForm">
					<input type="hidden" id="editUser_id" name="id">
					<div class="form-group" >
						<label for="name">账号：</label>
						<input class="form-control" id="editUser_account" disabled />
					</div>
					<div class="form-group" >
						<label for="editUser_uploadFile">头像：</label>
						<img id="editUser_pictue" style="width: 100%;"><br/>
						<input class="form-control-file" type="file" id="editUser_uploadFile" name="file" accept="image/png,image/gif,image/jpeg,image/jpg" onchange="uploadPic()"/>
						<input type="hidden" name="avatar" id="editUser_avatar">
					</div>
					<div class="form-group" >
						<label for="editUser_username">昵称：</label>
						<input class="form-control" placeholder="" type="text" name="username" id="editUser_username">
					</div>
					<div class="form-group" >
						<label for="editUser_mobile">手机号：</label>
						<input class="form-control" id="editUser_mobile" disabled />
					</div>
					<div class="form-group" >
						<label for="editUser_partyName">真是姓名：</label>
						<input class="form-control" placeholder="" type="text" name="partyName" id="editUser_partyName">
					</div>
					<div class="form-group" >
						<label for="editUser_address">地址：</label>
						<input class="form-control" placeholder="" type="text" name="address" id="editUser_address">
					</div>
					<div class="form-group">
						<label for="editUser_status">状态：</label>
						<select class="form-control" name="status" id ="editUser_status">
							<option value="0">正常</option>
							<option value="1">冻结</option>
						</select>
					</div>
					<div class="form-group">
						<label for="editUser_gender">性别：</label>
						<select class="form-control" name="gender" id ="editUser_gender">
							<option value="0">未知</option>
							<option value="1">男</option>
							<option value="2">女</option>
						</select>
					</div>
					<div class="form-group" >
						<label for="editUser_idCard">身份证号：</label>
						<input class="form-control" id="editUser_idCard" disabled />
					</div>
					<div class="form-group" >
						<label for="editUser_age">年龄：</label>
						<input class="form-control" placeholder="" type="text" name="age" id="editUser_age">
					</div>
				</form>
			</div>
			<div class="modal-footer" style="display: block; text-align: center">
				<button type="button" class="btn btn-light" style="width: 40%; max-width: 10rem;" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-info" style="width: 40%; max-width: 10rem;" onclick="confirmEdit();">确定</button>
			</div>
		</div>
	</div>
</div>

<!-- page script -->
<script>
	// 取得通过html传递的参数
	var listPage = 1;
	var paramListPage = getHtmlParams("page");
	if (paramListPage != null) {
		listPage = paramListPage;
	}
	var searchKey = "";
	var paramSearchKey = getHtmlParams("searchKey");
	if (paramSearchKey != null) {
		searchKey = paramSearchKey;
	}
	var userId = 0;
	var paramUserId = getHtmlParams("userId");
	if (paramUserId != null) {
		userId = paramUserId;
	}
	var userPoint = 0;
	var paramUserPoint = getHtmlParams("userPoint");
	if (paramUserPoint != null) {
		userPoint = paramUserPoint;
	}
	var userCredit = 0;
	var paramUserCredit = getHtmlParams("userCredit");
	if (paramUserCredit != null) {
		userCredit = paramUserCredit;
	}
	// 取后清空
	clearHtmlParams();

	//获取众筹单id
	$(document).ready(function() {
		//加载数据
		getUserDetail();
		getUserCrowdfundList();
		getUserCardList();
		getUserPointList();
		getUserCreditList();
		getUserAmtList();
		$("#totalPoint").html(userPoint);
		$("#totalCreditPoint").html(userCredit);
	});

	function goUserList() {
		let url = "/mobile/pages/user/userList.html";
		let params = {
				"htmlParams": [
						{
							"key" : "page",
							"value" : listPage
						},
						{
							"key" : "searchKey",
							"value" : searchKey
						}
				]
		}
		getHtml(url, params);
	}

	function getUserDetail() {
		let url = "/user/getUserById";
		let params = {
				"id" : userId
		}
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let user = data.user;
				$("#infoUserId").html(user.id);
				$("#infoAccount").html(user.account);
				$("#infoWalletTotal").html(user.wallet.toFixed(2) + "元");
				$("#infoRedbagTotal").html(user.redbagTotal.toFixed(2) + "元");
				$("#infoUserPoint").html(user.userPoint);
				$("#infoCreditPoint").html(user.creditPoint);
				if (user.isPlus == 1) {
					$("#infoIsPlus").html("是");
					$("#infoPlusExpireTime").html(toDate(user.plusExpireTime).format('yyyy-MM-dd'));
					$("#infoPlusExpireTime").parent().show();
				} else {
					$("#infoIsPlus").html("否");
					$("#infoPlusExpireTime").parent().hide();
				}
				if (!!user.avatar) {
					let imgHtml = '<img class="img" src="' + user.avatar + '" onclick="maxImg(' + "'" + user.avatar + "'" + ",'" + '头像' + "'" + ')" alt="头像">';
					$("#infoAvatar").html(imgHtml);
				}
				$("#infoUserName").html(user.username);
				if (user.gender == 1) {
					$("#infoGender").html("男");
				} else if (user.gender == 2) {
					$("#infoGender").html("女");
				} else {
					$("#infoGender").html("未知");
				}
				$("#infoAge").html(user.age);
				$("#infoMobile").html(user.mobile);
				$("#infoIdCard").html(user.idCard);
				$("#infoValue").html(user.value);
				$("#infoPartyName").html(user.partyName);
				$("#infoSysRedbagCount").html(user.sysRedbagCount);
				$("#infoSysWheelCount").html(user.sysWheelCount);
				$("#infoConvertWheelCount").html(user.convertWheelCount);
				$("#infoCrowdfundCount").html(user.crowdfundCount);
				$("#infoContribution").html(user.contribution);
				let status = user.status;
				let statusHtml = "";
				if (status == 0) {
					statusHtml += '<span class="status badge badge-success">正常</span>';
				} else if (status == 1) {
					statusHtml += '<span class="status badge badge-danger">冻结</span>';
				} else if (status == 2) {
					statusHtml += '<span class="status badge badge-secondary">注销</span>';
				}
				$("#infoStatus").html(statusHtml);
				$("#infoCreateTime").html(user.createTime);
			}
		});
	}

	var maxCount_crowdfund = 10;
	var totalPages_crowdfund = 0;
	var page_crowdfund = 1;
	var searchClick_crowdfund = false;

	function search_crowdfund() {
		searchClick_crowdfund = true;
		totalPages_crowdfund = 0;
		page_crowdfund = 1;
		getUserCrowdfundList();
	}

	function goPrevious_crowdfund() {
		if (page_crowdfund > 1) {
			page_crowdfund = page_crowdfund - 1;
			getUserCrowdfundList();
		}
	}

	function goNext_crowdfund() {
		if (page_crowdfund < totalPages_crowdfund) {
			page_crowdfund = page_crowdfund + 1;
			getUserCrowdfundList();
		}
	}

	function getUserCrowdfundList() {
		let searchSort_crowdfund = $("#searchSort_crowdfund").val();
		if (searchSort_crowdfund == '2') {
			searchSort_crowdfund = 'desc';
		} else {
			searchSort_crowdfund = '';
		}
		let searchStatus_crowdfund = $("#searchStatus_crowdfund").val();
		let searchCardType_crowdfund = $("#searchCardType_crowdfund").val();
		let searchType_crowdfund = $("#searchType_crowdfund").val();
		let searchKey_crowdfund = $("#searchKey_crowdfund").val();
		let startIndex_crowdfund = (page_crowdfund - 1) * maxCount_crowdfund;

		let url = "/crowdfund/getCrowdfundList";
		let params = {
				"uid" : userId,
				"sort" : searchSort_crowdfund,
				"status" : searchStatus_crowdfund,
				"cardType" : searchCardType_crowdfund,
				"keyWord" : searchKey_crowdfund,
				"start" : startIndex_crowdfund,
				"length" : maxCount_crowdfund,
				"draw" : page_crowdfund
		}
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let dataList = data.data;
				let totalCount = data.recordsTotal;
				if ((totalCount % maxCount_crowdfund) > 0) {
					totalPages_crowdfund = parseInt(totalCount / maxCount_crowdfund) + 1;
				} else {
					totalPages_crowdfund = parseInt(totalCount / maxCount_crowdfund);
				}
				if (page_crowdfund <= 1) {
					$("#pageList_crowdfund .previous").addClass("disabled");
				} else {
					$("#pageList_crowdfund .previous").removeClass("disabled");
				}
				if (page_crowdfund >= totalPages_crowdfund) {
					$("#pageList_crowdfund .next").addClass("disabled");
				} else {
					$("#pageList_crowdfund .next").removeClass("disabled");
				}
				if (totalPages_crowdfund <= 1) {
					$("#pageList_crowdfund").hide();
				} else {
					$("#pageList_crowdfund").show();
				}

				let dataHtml = '';
				for (let i = 0; i < dataList.length; i++) {
					let dataRecord = dataList[i];
					let id = dataRecord.id;
					let img = dataRecord.img;
					let imgUrls;
					if (img != '') {
						imgUrls = img.split("$");
					} else {
						imgUrls = new Array("");
					}
					let type = dataRecord.type;
					let typeStr = "";
					if(type == 1){
						typeStr = "江湖救急"
					} else if(type == 2){
						typeStr = "还房贷";
					} else if(type == 3){
						typeStr = "还车贷";
					} else if(type == 4){
						typeStr = "还信用卡";
					} else if(type == 5){
						typeStr = "求助";
					}
					let status = dataRecord.status;
					let entTime = toDate(dataRecord.endTime).format('yyyy-MM-dd')

					dataHtml += '<div class="card" id="crowdfund' + i + '">';
					dataHtml += '<div class="card-header" id="crowdfundHeader' + i + '">';
					dataHtml += '<div>';
					dataHtml += '<div class="btn btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#crowdfundCollapse' + i + '" aria-expanded="true" aria-controls="crowdfundCollapse' + i + '">';
					dataHtml += '<div class="card-title">' + dataRecord.title + '</div>';
					dataHtml += '<div class="card-item"><span class=left>' + typeStr + '</span><span class="right">' + entTime + '</span></div>';
					dataHtml += '<div class="card-item"><span class="left">' + dataRecord.userAccount + '</span><span class="right">' + dataRecord.partyName + '</span></div>';
					dataHtml += '<div class="card-item"><span class="left">' + dataRecord.billMoney + '</span><span class="right">' + dataRecord.currentMoney + '/' + dataRecord.targetMoney + '</span></div>';
					dataHtml += '<div class="card-status">';
					if (status == 0) {
						dataHtml += '<div class="status"><span class="badge badge-primary">待审核</span></div>';
					} else if (status == 1) {
						dataHtml += '<div class="status"><span class="badge badge-success">进行中</span></div>';
					} else if (status == 2) {
						dataHtml += '<div class="status"><span class="badge badge-warning">付款中</span></div>';
					} else if (status == 3) {
						dataHtml += '<div class="status"><span class="badge badge-secondary">已完成</span></div>';
					} else if (status == 4) {
						dataHtml += '<div class="status"><span class="badge badge-success">进行中(已扣分)</span></div>';
					} else if (status == 5) {
						dataHtml += '<div class="status"><span class="badge badge-danger">已驳回</span></div>';
					} else if (status == 6) {
						dataHtml += '<div class="status"><span class="badge badge-secondary">已失效</span></div>';
					} else if (status == 21) {
						dataHtml += '<div class="status"><span class="badge badge-warning">付款中(暂停付款)</span></div>';
					} else if (status == 22) {
						dataHtml += '<div class="status"><span class="badge badge-success">进行中(已证明)</span></div>';
					}
					dataHtml += '</div>';

					dataHtml += '</div>';
					dataHtml += '</div>';
					dataHtml += '</div>';
					
					dataHtml += '<div id="crowdfundCollapse' + i + '" class="collapse" aria-labelledby="crowdfundHeader' + i + '" data-parent="#listBox_crowdfund">';
					dataHtml += '<div class="card-body">';
					dataHtml += '<div class="card-img-box">';
					for (let j = 0; j < imgUrls.length; j++) {
						dataHtml += '<img src="' + imgUrls[j] + '" class="card-img" onclick="maxImg(' + "'" + imgUrls[j] + "'" + ",'" + '账单' + "'" + ')" alt="账单">';
					}
					dataHtml += '</div>';
					
					
					dataHtml += '</div>';
					dataHtml += '</div>';
					
					
					dataHtml += '</div>';
				}
				$("#listBox_crowdfund").html(dataHtml);
				if (totalCount > 0) {
					let startNum = startIndex_crowdfund + 1;
					let endNum = startIndex_crowdfund + dataList.length;
					$("#dataInfo_crowdfund").html('从 ' + startNum + ' 到 ' + endNum + ' /共 ' + totalCount + ' 条数据');
					if (searchClick_crowdfund) {
						$("#searchBoxCollapse_crowdfund").click();
					}
				} else {
					$("#dataInfo_crowdfund").html('没有检索到数据');
				}
				document.body.scrollTop = document.documentElement.scrollTop = 0;
				for (let i = 0; i < dataList.length; i++) {
					$("#crowdfundCollapse" + i).on('show.bs.collapse', function () {
						$(this).parent().attr("style", "overflow: visible; z-index: 1; box-shadow: 1px 2px 10px #2aaf98;");
					});
					$("#crowdfundCollapse" + i).on('hide.bs.collapse', function () {
						$(this).parent().removeAttr("style");
					});
				}
			}
			searchClick_crowdfund = false;
		}, true);
	}

	var maxCount_card = 10;
	var totalPages_card = 0;
	var page_card = 1;
	var searchClick_card = false;

	function search_card() {
		searchClick_card = true;
		totalPages_card = 0;
		page_card = 1;
		getUserCardList();
	}
	
	function goPrevious_card() {
		if (page_card > 1) {
			page_card = page_card - 1;
			getUserCardList();
		}
	}
	
	function goNext_card() {
		if (page_card < totalPages_card) {
			page_card = page_card + 1;
			getUserCardList();
		}
	}

	function getUserCardList(){
		let searchKey_card = $("#searchKey_card").val();
		let startIndex_card = (page_card - 1) * maxCount_card;

		let url = "/card/getCardByUserId";
		let params = {
				"userId" : userId,
				"cardKey" : searchKey_card,
				"start" : startIndex_card,
				"length" : maxCount_card,
				"draw" : page_card
		};
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let dataList = data.data;
				let totalCount = data.recordsTotal;
				if ((totalCount % maxCount_card) > 0) {
					totalPages_card = parseInt(totalCount / maxCount_card) + 1;
				} else {
					totalPages_card = parseInt(totalCount / maxCount_card);
				}
				if (page_card <= 1) {
					$("#pageList_card .previous").addClass("disabled");
				} else {
					$("#pageList_card .previous").removeClass("disabled");
				}
				if (page_card >= totalPages_card) {
					$("#pageList_card .next").addClass("disabled");
				} else {
					$("#pageList_card .next").removeClass("disabled");
				}
				if (totalPages_card <= 1) {
					$("#pageList_card").hide();
				} else {
					$("#pageList_card").show();
				}

				let dataHtml = '';
				for (let i = 0; i < dataList.length; i++) {
					let dataRecord = dataList[i];
					let id = dataRecord.id;
					let status = dataRecord.status;
					let payStatus = dataRecord.payStatus;
					let payError = dataRecord.payError;
					let type = dataRecord.type;
					let backDay = dataRecord.backDay;
					let paymentDay = dataRecord.paymentDay;
					let typeStr = "";
					let backDayStr = "无";
					let paymentDayStr = "无";
					if (type == 0) {
						typeStr = "信用卡";
						paymentDayStr = "每月" + paymentDay + "号";
					} else if (type == 1) {
						typeStr = "储蓄卡";
					} else if (type == 2) {
						//typeStr = "支付宝";
					}
					if (backDay != 0) {
						backDayStr = "每月" + backDay + "号";
					}

					dataHtml += '<div class="card" id="card' + i + '">';
					dataHtml += '<div class="card-header" id="cardHeader' + i + '">';
					dataHtml += '<div>';
					dataHtml += '<div class="btn btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#cardCollapse' + i + '" aria-expanded="true" aria-controls="cardCollapse' + i + '">';
					dataHtml += '<div class="card-title">' + dataRecord.cardNum + '</div>';
					dataHtml += '<div class="card-item">';
					dataHtml += '<span class="left">' + dataRecord.bankName;
					if (dataRecord.enBankName != null && dataRecord.enBankName != "") {
						dataHtml += '(' + dataRecord.enBankName + ')';
					}
					dataHtml += '</span>';
					dataHtml += '<span class="right">' + typeStr + '</span>';
					dataHtml += '</div>';
					dataHtml += '<div class="card-item"><span class="left">' + '还款日：' + '</span><span class="right">' + backDayStr  + '</span></div>';
					dataHtml += '<div class="card-item"><span class="left">' + '账单日：' + '</span><span class="right">' + paymentDayStr  + '</span></div>';
					dataHtml += '<div class="card-status">';
					if (status == 0) {
						dataHtml += '<div class="status"><span class="badge badge-success">已绑定</span></div>';
					} else if (status == 1) {
						dataHtml += '<div class="status"><span class="badge badge-secondary">已解绑</span></div>';
					}
					if (status == 0) {
						if (payStatus == 0) {
							if (payError == 1) {
								dataHtml += '<div class="pay-status"><span class="badge badge-warning">支付异常</span></div>';
							} else {
								dataHtml += '<div class="pay-status"><span class="badge badge-success">正常</span></div>';
							}
						} else if (payStatus == 1) {
							dataHtml += '<div class="pay-status"><span class="badge badge-danger">不可支付</span></div>';
						}
					}
					dataHtml += '</div>';
					dataHtml += '<div class="card-time">' + dataRecord.createTime + '</div>';

					dataHtml += '</div>';
					dataHtml += '</div>';
					dataHtml += '</div>';
					
					dataHtml += '<div id="cardCollapse' + i + '" class="collapse" aria-labelledby="cardHeader' + i + '" data-parent="#listBox_card">';
					dataHtml += '<div class="card-body">';

					dataHtml += '<ul class="card-opt">';
					dataHtml += '<li class="text-secondary" onclick="viewCostRecords(' + id + ')"><i class="fa fa-file-text-o"></i><span>消费记录</span></li>';
					dataHtml += '<li class="text-secondary" onclick="viewMonthBill(' + id + ')"><i class="fa fa-file-text"></i><span>月度账单</span></li>';
					dataHtml += '</ul>';
					
					dataHtml += '</div>';
					dataHtml += '</div>';
					
					dataHtml += '</div>';
				}
				$("#listBox_card").html(dataHtml);
				if (totalCount > 0) {
					let startNum = startIndex_card + 1;
					let endNum = startIndex_card + dataList.length;
					$("#dataInfo_card").html('从 ' + startNum + ' 到 ' + endNum + ' /共 ' + totalCount + ' 条数据');
					if (searchClick) {
						$("#searchBoxCollapse_card").click();
					}
				} else {
					$("#dataInfo_card").html('没有检索到数据');
				}
				document.body.scrollTop = document.documentElement.scrollTop = 0;
				for (let i = 0; i < dataList.length; i++) {
					$("#cardCollapse" + i).on('show.bs.collapse', function () {
						$(this).parent().attr("style", "overflow: visible; z-index: 1; box-shadow: 1px 2px 10px #2aaf98;");
					});
					$("#cardCollapse" + i).on('hide.bs.collapse', function () {
						$(this).parent().removeAttr("style");
					});
				}
			}
			searchClick = false;
		}, true);
	}

	var maxCount_point = 10;
	var totalPages_point = 0;
	var page_point = 1;
	var searchClick_point = false;

	function search_point() {
		searchClick_point = true;
		totalPages_point = 0;
		page_point = 1;
		getUserPointList();
	}
	
	function goPrevious_point() {
		if (page_point > 1) {
			page_point = page_point - 1;
			getUserPointList();
		}
	}
	
	function goNext_point() {
		if (page_point < totalPages_point) {
			page_point = page_point + 1;
			getUserPointList();
		}
	}

	function getUserPointList(){
		let searchStartDate_point = $("#searchStartDate_point").val();
		let searchEndDate_point = $("#searchEndDate_point").val();
		if (searchStartDate_point != "" && searchEndDate_point != "") {
			if (searchEndDate_point < searchStartDate_point) {
				showErrorMessageTip("开始日期不能大于结束日期！", "#searchStartDate_point");
				return ;
			}
		}
		let startIndex_point = (page_point - 1) * maxCount_point;

		let url = "/user/getUserPoints";
		let params = {
				"userId" : userId,
				"startDate" : searchStartDate_point,
				"endDate" : searchEndDate_point,
				"start" : startIndex_point,
				"length" : maxCount_point,
				"draw" : page_point
		};
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let dataList = data.data;
				let totalCount = data.recordsTotal;
				if ((totalCount % maxCount_point) > 0) {
					totalPages_point = parseInt(totalCount / maxCount_point) + 1;
				} else {
					totalPages_point = parseInt(totalCount / maxCount_point);
				}
				if (page_point <= 1) {
					$("#pageList_point .previous").addClass("disabled");
				} else {
					$("#pageList_point .previous").removeClass("disabled");
				}
				if (page_point >= totalPages_point) {
					$("#pageList_point .next").addClass("disabled");
				} else {
					$("#pageList_point .next").removeClass("disabled");
				}
				if (totalPages_point <= 1) {
					$("#pageList_point").hide();
				} else {
					$("#pageList_point").show();
				}

				let dataHtml = '';
				for (let i = 0; i < dataList.length; i++) {
					let dataRecord = dataList[i];
					let id = dataRecord.id;
					let type = dataRecord.type;
					let typeStr = "";
					if (type == 1) {
						typeStr = "签到";
					} else if (type == 2) {
						typeStr = "大转盘";
					} else if (type == 3) {
						typeStr = "众筹互助";
					} else if (type == 4) {
						typeStr = "分享朋友圈";
					} else if (type == 5) {
						typeStr = "分享微信好友";
					} else if (type == 6) {
						typeStr = "发全名红包";
					} else if (type == 7) {
						typeStr = "完成实名认证";
					} else if (type == 8) {
						typeStr = "大转盘抽奖兑换";
					} else if (type == 9) {
						typeStr = "积分商城兑换";
					}

					if (i == 0) {
						dataHtml += '<div class="list-item" style="border-top: 1px solid rgba(0,0,0,.125);">';
					} else {
						dataHtml += '<div class="list-item">';
					}
					//dataHtml += '<div>' + id + '</div>';
					dataHtml += '<div>';
					dataHtml += '<div class="left">' + typeStr + '</div>';
					dataHtml += '<div class="right">' + dataRecord.point + '</div>';
					dataHtml += '</div>';
					dataHtml += '<div class="time">' + dataRecord.createTime + '</div>';
					dataHtml += '</div>';
				}
				$("#listBox_point").html(dataHtml);
				if (totalCount > 0) {
					let startNum = startIndex_point + 1;
					let endNum = startIndex_point + dataList.length;
					$("#dataInfo_point").html('从 ' + startNum + ' 到 ' + endNum + ' /共 ' + totalCount + ' 条数据');
					if (searchClick_point) {
						$("#searchBoxCollapse_point").click();
					}
				} else {
					$("#dataInfo_point").html('没有检索到数据');
				}
				document.body.scrollTop = document.documentElement.scrollTop = 0;
				for (let i = 0; i < dataList.length; i++) {
					$("#pointCollapse" + i).on('show.bs.collapse', function () {
						$(this).parent().attr("style", "overflow: visible; z-index: 1; box-shadow: 1px 2px 10px #2aaf98;");
					});
					$("#pointCollapse" + i).on('hide.bs.collapse', function () {
						$(this).parent().removeAttr("style");
					});
				}
			}
			searchClick_point = false;
		}, true);
	}

	var maxCount_credit = 10;
	var totalPages_credit = 0;
	var page_credit = 1;
	var searchClick_credit = false;

	function search_credit() {
		searchClick_credit = true;
		totalPages_credit = 0;
		page_credit = 1;
		getUserCreditList();
	}
	
	function goPrevious_credit() {
		if (page_credit > 1) {
			page_credit = page_credit - 1;
			getUserCreditList();
		}
	}
	
	function goNext_credit() {
		if (page_credit < totalPages_credit) {
			page_credit = page_credit + 1;
			getUserCreditList();
		}
	}

	function getUserCreditList(){
		let searchType_credit = $("#searchType_credit").val();
		let startIndex_credit = (page_credit - 1) * maxCount_credit;

		let url = "/user/getUserCreditPoints";
		let params = {
				"userId" : userId,
				"type" : searchType_credit,
				"start" : startIndex_credit,
				"length" : maxCount_credit,
				"draw" : page_credit
		};
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let dataList = data.data;
				let totalCount = data.recordsTotal;
				if ((totalCount % maxCount_credit) > 0) {
					totalPages_credit = parseInt(totalCount / maxCount_credit) + 1;
				} else {
					totalPages_credit = parseInt(totalCount / maxCount_credit);
				}
				if (page_credit <= 1) {
					$("#pageList_credit .previous").addClass("disabled");
				} else {
					$("#pageList_credit .previous").removeClass("disabled");
				}
				if (page_credit >= totalPages_credit) {
					$("#pageList_credit .next").addClass("disabled");
				} else {
					$("#pageList_credit .next").removeClass("disabled");
				}
				if (totalPages_credit <= 1) {
					$("#pageList_credit").hide();
				} else {
					$("#pageList_credit").show();
				}

				let dataHtml = '';
				for (let i = 0; i < dataList.length; i++) {
					let dataRecord = dataList[i];
					let id = dataRecord.id;
					let type = dataRecord.type;
					let typeStr = "";
					if (type == 1) {
						typeStr = "发红包";
					} else if (type == 2) {
						typeStr = "互助";
					} else if (type == 3) {
						typeStr = "登录";
					} else if (type == 4) {
						typeStr = "其它";
					} else if (type == 5) {
						typeStr = "违规";
					} else if (type == 6) {
						typeStr = "申诉";
					}

					if (i == 0) {
						dataHtml += '<div class="list-item" style="border-top: 1px solid rgba(0,0,0,.125);">';
					} else {
						dataHtml += '<div class="list-item">';
					}
					dataHtml += '<div>';
					dataHtml += '<div class="left">' + typeStr + '</div>';
					dataHtml += '<div class="right">' + dataRecord.creditPoint + '</div>';
					dataHtml += '</div>';
					dataHtml += '<div>' + dataRecord.reason + '</div>';
					dataHtml += '<div class="time">' + dataRecord.createTime + '</div>';
					dataHtml += '</div>';
				}
				$("#listBox_credit").html(dataHtml);
				if (totalCount > 0) {
					let startNum = startIndex_credit + 1;
					let endNum = startIndex_credit + dataList.length;
					$("#dataInfo_credit").html('从 ' + startNum + ' 到 ' + endNum + ' /共 ' + totalCount + ' 条数据');
					if (searchClick_credit) {
						$("#searchBoxCollapse_credit").click();
					}
				} else {
					$("#dataInfo_credit").html('没有检索到数据');
				}
				document.body.scrollTop = document.documentElement.scrollTop = 0;
				for (let i = 0; i < dataList.length; i++) {
					$("#creditCollapse" + i).on('show.bs.collapse', function () {
						$(this).parent().attr("style", "overflow: visible; z-index: 1; box-shadow: 1px 2px 10px #2aaf98;");
					});
					$("#creditCollapse" + i).on('hide.bs.collapse', function () {
						$(this).parent().removeAttr("style");
					});
				}
			}
			searchClick_credit = false;
		}, true);
	}

	var maxCount_amt = 10;
	var totalPages_amt = 0;
	var page_amt = 1;
	var searchClick_amt = false;

	function search_amt() {
		searchClick_amt = true;
		totalPages_amt = 0;
		page_amt = 1;
		getUserAmtList();
	}
	
	function goPrevious_amt() {
		if (page_amt > 1) {
			page_amt = page_amt - 1;
			getUserAmtList();
		}
	}
	
	function goNext_amt() {
		if (page_amt < totalPages_amt) {
			page_amt = page_amt + 1;
			getUserAmtList();
		}
	}

	function getUserAmtList(){
		let searchType_amt = $("#searchType_amt").val();
		let startIndex_amt = (page_amt - 1) * maxCount_amt;

		getTotalUsableAmt(searchType_amt);

		let url = "/user/getUserUsableAmtList";
		let params = {
				"userId" : userId,
				"type" : searchType_amt,
				"start" : startIndex_amt,
				"length" : maxCount_amt,
				"draw" : page_amt
		};
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let dataList = data.data;
				let totalCount = data.recordsTotal;
				if ((totalCount % maxCount_amt) > 0) {
					totalPages_amt = parseInt(totalCount / maxCount_amt) + 1;
				} else {
					totalPages_amt = parseInt(totalCount / maxCount_amt);
				}
				if (page_amt <= 1) {
					$("#pageList_amt .previous").addClass("disabled");
				} else {
					$("#pageList_amt .previous").removeClass("disabled");
				}
				if (page_amt >= totalPages_amt) {
					$("#pageList_amt .next").addClass("disabled");
				} else {
					$("#pageList_amt .next").removeClass("disabled");
				}
				if (totalPages_amt <= 1) {
					$("#pageList_amt").hide();
				} else {
					$("#pageList_amt").show();
				}

				let dataHtml = '';
				for (let i = 0; i < dataList.length; i++) {
					let dataRecord = dataList[i];
					let id = dataRecord.id;
					let type = dataRecord.type;
					let typeStr = "";
					if (type == 0) {
						typeStr = "永久额度";
					} else if (type == 1) {
						typeStr = "临时额度";
					}

					if (i == 0) {
						dataHtml += '<div class="list-item" style="border-top: 1px solid rgba(0,0,0,.125);">';
					} else {
						dataHtml += '<div class="list-item">';
					}
					dataHtml += '<div>';
					dataHtml += '<div class="left">' + typeStr + '</div>';
					dataHtml += '<div class="right">' + dataRecord.money + '</div>';
					dataHtml += '</div>';
					dataHtml += '<div>' + dataRecord.remark + '</div>';
					dataHtml += '<div class="time">' + dataRecord.orderTime + '</div>';
					dataHtml += '</div>';
				}
				$("#listBox_amt").html(dataHtml);
				if (totalCount > 0) {
					let startNum = startIndex_amt + 1;
					let endNum = startIndex_amt + dataList.length;
					$("#dataInfo_amt").html('从 ' + startNum + ' 到 ' + endNum + ' /共 ' + totalCount + ' 条数据');
					if (searchClick_amt) {
						$("#searchBoxCollapse_amt").click();
					}
				} else {
					$("#dataInfo_amt").html('没有检索到数据');
				}
				document.body.scrollTop = document.documentElement.scrollTop = 0;
				for (let i = 0; i < dataList.length; i++) {
					$("#amtCollapse" + i).on('show.bs.collapse', function () {
						$(this).parent().attr("style", "overflow: visible; z-index: 1; box-shadow: 1px 2px 10px #2aaf98;");
					});
					$("#amtCollapse" + i).on('hide.bs.collapse', function () {
						$(this).parent().removeAttr("style");
					});
				}
			}
			searchClick_amt = false;
		}, true);
	}

	function getTotalUsableAmt(searchType) {
		let url = "/user/getTotalUsableAmt";
		let params = {
				"userId" : userId,
				"type" : searchType
		}
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				$("#usableAmt").text(data.usableAmt);
				$("#fixedAmt").text(data.fixedAmt);
				$("#permanentAmt").text(data.permanentAmt);
				$("#infoUsableAmt").text(data.usableAmt);
			}
		});
	}

	function showEditDialog(id) {
		$("#editUser_pictue").attr("src","");
		let url = "/user/getUserById";
		let params = {
				"id" : userId
		}
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				let user = data.user;
				$("#editUser_id").val(user.id);
				$("#editUser_account").val(user.account);
				$("#editUser_avatar").val(user.avatar);
				$("#editUser_pictue").attr("src",user.avatar);
				$("#editUser_username").val(user.username);
				$("#editUser_mobile").val(user.mobile);
				$("#editUser_partyName").val(user.partyName);
				$("#editUser_address").val(user.address);
				$("#editUser_status").val(user.status);
				$("#editUser_gender").val(user.gender);
				$("#editUser_idCard").val(user.idCard);
				$("#editUser_age").val(user.age);

				$("#editTitle").text("编辑用户信息");
				$("#editPanel").modal("show");
			}
		}, true);
	}

	function confirmEdit() {
		let status = $("#editUser_status").val();
		if( $.trim(status)  == ""){
			showErrorMessageTip("状态不能为空！", "#editUser_status");
			return ;
		}
		let url = "/user/updateUser";
		let params = JSON.stringify($("#editForm").serializeObject());
		let contentType = "application/json;charset=UTF-8";
		getMapData(url, params, function(data, result) {
			if (result == "success") {
				$("#editPanel").modal("hide");
				getUserDetail();
			}
		}, true, false, false, contentType);
	}

	//上传图片
	function uploadPic() {
		var formData=new FormData();
		formData.append("pic",document.getElementById("editUser_uploadFile").files[0]);
		formData.append("type",3);
		$.ajax({
			type : 'post',
			url : "/upload/uploadPicFile",
			data: formData,
			contentType: false,
			processData: false,
			success : function(data) {
				let error = data.error;
				let message = data.message;
				if (error) {
					showErrorMessageBox(message);
				} else {
					let url = data.data.url;
					$("#editUser_pictue").attr("src",url);
					$("#editUser_avatar").val(url)
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				showErrorMessageBox("请求超时，请重试");
			}
		});
	}

	function viewCostRecords() {
		showInfoMessageBox("无消费记录");
	}

	function viewMonthBill() {
		showInfoMessageBox("无月度账单");
	}

</script>
</body>
</html>
